package com.example.jbservice.Controller;

import com.example.jbservice.Dto.InvoiceDto;
import com.example.jbservice.Result.Result;
import com.example.jbservice.Service.InvoiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/invoice")
public class InvoiceController {

	@Autowired
	private InvoiceService invoiceService;

	@GetMapping("/GetAllInvoice")
	public Result<List<InvoiceDto>> GetAllInvoice(){

		List<InvoiceDto> invoiceDtos = invoiceService.GetAllInvoice();
		return  Result.success(invoiceDtos);
	}
}
